20 PRINT " The Poisson distribution is a one-tailed exact test that applies specifically ": PRINT " when the number of SUCCESSES can be counted but the number of FAILURES cannot."
30 PRINT TAB(8);"It can also be used to approximate the binomial distribution": PRINT TAB(4);"when the number of trials is > 100 and the the population rate is < 5% ."
40 PRINT: PRINT : PRINT TAB(8);
50 INPUT "Enter the number of cases OBSERVED (integer): ",NO: PRINT
60 PRINT TAB(8);"Enter the number of cases EXPECTED (may be fraction):": PRINT TAB(15);
70 PRINT "(e.g. population rate * time interval)": LOCATE 13,64: INPUT"", E
75 COLOR 23:PRINT:PRINT:PRINT:AP=CSRLIN:PRINT TAB(25);"CALCULATING PROBABILITY"
80 AF=0: CO=NO: CE=0: IF E<CO THEN CO=CO-1: AF=1
90 IF CO=0 THEN SF=1 ELSE SF=E+1
100 F=E: FOR Z=2 TO CO: F=F*E/Z: IF F>1E+22 THEN F=F*0: SF=SF* 0: CE=CE+1
110 IF F<0 THEN 120 ELSE SF=SF+F: NEXT Z
120 SL=LOG(SF)-E+CE*50: IF SL>80 THEN P=0 ELSE P=EXP(SL)
130 IF AF=1 THEN P=1-P
140 PLAY "MB O3 T120 L16 MS CCGE L6 C"
160 COLOR 0,7: LOCATE AP,1: PRINT TAB(8);"The probability of observing ";NO;" or ";
170 IF AF=1 THEN PRINT "more cases = "; ELSE PRINT "fewer cases = ";
190 IF P<9E-09 THEN PRINT "< 10 (-8)"; ELSE IF P>0.95 THEN PRINT "> .95"; ELSE PRINT P;
200 PRINT TAB(80): COLOR 7,0: PRINT: PRINT: PRINT: INPUT "Do you want to perform another Poisson distribution calculation? (Y or N) ",A$